{extend name="common/page"}
{block name="content"}
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">分类名</label>
        <div class="layui-input-block">
            <input type="text" name="name" required lay-verify="required" placeholder="请输入分类名" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">显示位置</label>
        <div class="layui-input-block">
            <select name="position" lay-verify="required">
                <option value="1">左侧栏</option>
                <option value="2">顶部导航</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">显示</label>
        <div class="layui-input-block">
            <input type="radio" name="display" value="1" title="是" checked>
            <input type="radio" name="display" value="2" title="否">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input value="100" type="number" name="list_order" required lay-verify="required" placeholder="请输入排序1-999整数，小在前" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="note" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="addForm">增加</button>
        </div>
    </div>
</form>
{/block}

{block name="script"}
{__block__}
<script>
    layui.use(['form'], function () {
        $k.submit('addForm', '/privilege/category/add', function () {
            // reload category data table to refresh data
            $k.reload(parent.tableInst, '/privilege/category/all');
            // 关闭父级弹出层
            $k.adminClose();
        })
    })
</script>
{/block}